package com.cskaoyan.shopping.converter;

import com.cskaoyan.shopping.dal.entitys.Item;
import com.cskaoyan.shopping.dto.TestProductDetailDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * @auther cskaoyan
 * @date 2022/8/24:14:36
 */
@Mapper(componentModel = "spring")
public interface ITestProductConverter {

    // Item  -> TestProductDetailDto
    @Mapping(source = "title", target = "productName")
    @Mapping(source = "image", target = "imgUrls")
    TestProductDetailDto productDoToDto(Item item);
}
